#!/bin/bash



# LIMPA A LISTA
cp -f htpasswd A
for i in `awk '{print $1}'  us.lst` ; do

  #VER QUEM NAO ESTHA NA LISTA 
  # grep -i  "^$i:" htpasswd > /dev/null

  # if [ $? -gt 0 ] ; then
  #   echo $i
  # fi


  grep -v  "^$i:" A > B
  mv B A
done


for i in `awk '{print $1}'  us.lst` ; do

  #grep  "^$i:" htpasswd | awk 'BEGIN { FS=":"} { print $1":SENHANOVA:"$3}' >> A
  grep  "^$i:" htpasswd | awk 'BEGIN { FS=":"} { print $1":SENHAnull:null@planalto.gov.br"}' >> A

done

sort A > FINAL

rm -f A
